Skip to content

feat: Add Extensions to Rokt Kit#26

Merged
alexs-mparticle merged 9 commits into
developmentfrom
feat/SQDSDKS-7233-vnext-extensions
Jul 11, 2025
Merged

feat: Add Extensions to Rokt Kit#26
alexs-mparticle merged 9 commits into
developmentfrom
feat/SQDSDKS-7233-vnext-extensions

Conversation

@alexs-mparticle

@alexs-mparticle alexs-mparticle commented Apr 23, 2025

Copy link
Copy Markdown
Collaborator

Summary

Testing Plan

  • Using a sample app with placeholder divs, for example an offer-container, cancel-button and confirm-button.
  • Load the SDK and Kit with extensions via a kit config
  • Fire a select placement call
  • Execute a call to setExtensionData using the following in the dev console:
window.mParticle.Rokt.setExtensionData({
  '<extension-name>': {
    confirmBtn: '#confirm-button',
    cancelBtn: '#cancel-button',
    container: '#offer-container'
  }
});
  • Verify using the network tab that calls are made to https://apps.rokt.com/v1/events with:
    • SignalPartnerImpression
    • SignalPartnerResponse
    • SignalPartnerDismissal
  • ...are made upon the initial impression, confirm button click and cancel button click, respectively.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for vNext Extensions to the Rokt Kit by introducing new functions for generating launcher scripts and extracting extension data. The key changes include:

  • Adding unit tests in test/src/tests.js for generating launcher scripts with various extension inputs.
  • Implementing new functions (generateLauncherScript, parseSettingsString, extractvNextExtensions) to support vNext Extensions in src/Rokt-Kit.js.
  • Integrating the extension data with the Rokt SDK via a new setExtensionData method.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
test/src/tests.js Adds comprehensive unit tests for validating launcher script generation and extension extraction.
src/Rokt-Kit.js Implements vNextExtensions support including parsing settings and generating launcher URLs.
Comments suppressed due to low confidence (1)

src/Rokt-Kit.js:28

  • [nitpick] The local variable 'roktLauncherScript' declared inside the constructor shadows the earlier module-level declaration; consider renaming it to clarify its scope and intended usage.
var roktLauncherScript = '';

Comment thread src/Rokt-Kit.js Outdated
Comment thread src/Rokt-Kit.js
Comment thread src/Rokt-Kit.js Outdated
Comment thread src/Rokt-Kit.js Outdated
@alexs-mparticle alexs-mparticle marked this pull request as ready for review April 24, 2025 15:33
Comment thread src/Rokt-Kit.js Outdated
@alexs-mparticle alexs-mparticle requested a review from Copilot April 28, 2025 15:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for vNext Extensions to the Rokt Kit by introducing new helper functions and modifying the launcher script generation to correctly append extensions.

  • Introduces a constant mapping (VNEXT_EXTENSIONS) for known extension names.
  • Adds the generateLauncherScript helper to build URLs with extension query parameters.
  • Implements functions to extract vNext extensions from settings and to set extension data, along with corresponding tests.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/Rokt-Kit.js Implements vNext Extension support, helper functions for URL generation and data mapping
test/src/tests.js Adds tests for generateLauncherScript and extractvNextExtensions functions

Comment thread src/Rokt-Kit.js Outdated
@alexs-mparticle alexs-mparticle changed the title feat: Add vNext Extensions to Rokt Kit feat: Add Extensions to Rokt Kit Apr 29, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for vNext Extensions to the Rokt Kit, allowing users to configure extension data and generate a launcher script URL with query parameters based on a list of extensions. Key changes include:

  • Introduction of a constant mapping (ROKT_EXTENSIONS) and helper functions (generateLauncherScript, extractRoktExtensions, and setExtensionData) in the kit.
  • Enhancements in test coverage to validate URL generation and correct mapping of extension names.
  • Modifications to the script insertion logic in attachLauncher to incorporate extension parameters.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
test/src/tests.js Added tests for generateLauncherScript and extractRoktExtensions
src/Rokt-Kit.js Implemented support for extensions, including new helper methods and integration in the launcher creation process

Comment thread src/Rokt-Kit.js
Comment thread src/Rokt-Kit.js

@rmi22186 rmi22186 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approving, but we need to confirm with ignacio/sarthi how long adding a new cusom json mapping would take still

@alexs-mparticle alexs-mparticle force-pushed the feat/SQDSDKS-7233-vnext-extensions branch from d379eaa to c3d24d9 Compare June 9, 2025 14:49
@alexs-mparticle alexs-mparticle force-pushed the feat/SQDSDKS-7233-vnext-extensions branch from c3d24d9 to 1db3c91 Compare June 30, 2025 22:31
@alexs-mparticle alexs-mparticle merged commit 73e9696 into development Jul 11, 2025
4 checks passed
github-actions Bot pushed a commit that referenced this pull request Jul 14, 2025
# [1.6.0](v1.5.0...v1.6.0) (2025-07-14)

### Bug Fixes

* Prevent mutation of global launcherOptions during initialization ([#36](#36)) ([0f36fac](0f36fac))

### Features

* Add Extensions to Rokt Kit ([#26](#26)) ([73e9696](73e9696))
* Support adding identities to select placement attributes ([#35](#35)) ([f9595ea](f9595ea))
@alexs-mparticle alexs-mparticle deleted the feat/SQDSDKS-7233-vnext-extensions branch March 25, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants